<template>
		<div class="qrcode" ref="qr"></div>
</template>
<script>
	import QRCode from 'qrcodejs2';
	export default {
		props: {
			merchantID:String
		},
		data() {
			return {

			}
		},
		created() {
			
		},
		methods: {
			creatQrCode() {
				this.$nextTick(function() {
					let qrcode = new QRCode(this.$refs.qr, {
						//text: 'https://h5-2gj1ttf5d41dd74c-1307166704.tcloudbaseapp.com/jump-mp.html?merchantID='+this.merchantID, //多来贝线上支付
						text: 'https://duolaibei-2ghugzv5fbf83fe4-1310640942.tcloudbaseapp.com/jump-mp.html?merchantID='+this.merchantID, // 多来贝商家
						width: 400,
						height: 400,
						colorDark: '#000000',
						colorLight: '#ffffff',
						correctLevel: QRCode.CorrectLevel.H,
						// background: '#f0f',
						// foreground: '#ff0'
					});
				});
			},
			handleClose(done) {
				this.$confirm("确认关闭？")
					.then((_) => {
						done();
					})
					.catch((_) => {});
			},
		},
		mounted() {
			this.creatQrCode();
		},
	}
</script>

<style>
	.qrcode{
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>
